<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
   <style> 
   .box{
    color:red;
}</style>
</head>
<body>
    <div id="app">
      <button  @click="active=1" :class="{[red]:active===1}">选项卡1</button>
      <button  @click="active=2" :class="{[red]:active===2}">选项卡2</button>
      <button  @click="active=3" :class="{[red]:active===3}">选项卡3</button>
      <div>
        <div v-if="active===1">这个是第1个选项卡的内容</div>
        <div v-if="active===2">这个是第2个选项卡的内容</div>
        <div v-if="active===3">这个是第3个选项卡的内容</div>
      </div>
    </div>
</body>
<script src="./vue.js"> </script>
<script>
    let{createApp,ref}=Vue;
    createApp({

        setup(){
            let show1=ref(true);
            let show
            let red=ref('box');
            let active=ref(2);
            return{
              show,
              red,
              active
            }
        }
    }).mount("#app")
</script>
</html>